<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>





	<!--jquery-->
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <!--用百度的静态资源库的cdn安装bootstrap环境-->
    <!-- Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="../js/bootstrap/bootstrap3/css/bootstrap.css">
	<link rel="stylesheet" href="../js/bootstrap/bootstrap3/css/bootstrap-theme.css">
	
    <!--font-awesome 核心我CSS 文件-->
    <link rel="stylesheet" href="../css/Login.css">
    <!--font-awesome    -->
    <link rel="stylesheet" href="../js/bootstrap/Font-Awesome-3.2.1/css/font-awesome.css">
    
    <!-- Bootstrap 核心 JavaScript 文件 -->
	<script type="text/javascript" src="../js/bootstrap/bootstrap3/js/bootstrap.js"></script>

    <!-- 引入 bootbox.js -->
	<script src="../js/bootstrap/bootstrap-bootbox/bootbox.js"></script>
</head>
<body>
<div class="container">
    <div class="form row">
        <form id="myForm" class="form-horizontal col-sm-offset-3 col-md-offset-3">
            <h3 class="form-title">登录</h3>
            <div class="col-sm-9 col-md-9">
                <div class="form-group">
                    <!--        用户名图标和用户名输入框            -->
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="glyphicon glyphicon-user" aria-hidden="true"></i>
                    <input class="form-control" type="text" name="username" id="username" placeholder="请输入用户名" required autofocus>
                </div>
                    <!--        密码图标和密码输入框                -->
                <div class="form-group">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="glyphicon glyphicon-piggy-bank" aria-hidden="true"></i>
                    <input class="form-control " type="password" name="password" id="password" placeholder="请输入密码" required>
                </div>
                    <!--        用超链接跳转到注册页面               -->
                <div class="form-group">
                    <br>
                    <a href="/page/opopop">没有账号？立即注册</a>
                </div>
                    <!--         登录按钮           -->
                <div class="form-group">
                    <input type="button" value="登录" onclick="loginButton()" class="btn btn-success pull-right">
                </div>
            </div>
        </form>
    </div>
</div>

<script type="text/javascript">
	//登录按钮调用的函数
	function loginButton(){
        alert("测试")
        $.ajax({
            url:'/abc/log',
            type:"post",
            data:$("#myForm").serialize(),
            dataType:"text",//规定ajax返回值类型 把后台json字符串转换为js的json对象
            success:function(data){
                if(data == "登录成功"){
                    window.location.href = 'index.html';
                    // location.href="/page/toIndex";
                }else{
                    bootbox.alert({
                        size: "small",
                        title: "提示",
                        message: data});
                }
            },
        })
	}

</script>
</body>
</html>
